<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
// [js] 写一个函数找出给定数组中的最大差值
function maxDiff(nums) {
  let newNums = nums.flat(Infinity)
  return Math.max(...newNums) - Math.min(...newNums)
}
</script>
</html>